package com.situ.day5;

import org.junit.Test;

import java.util.Arrays;

public class OOPDemo {
    @Test
    public void test1() {
        Student student = new Student();
        //student.id = 1;
        student.setId(1);
        student.setName("张三");
        student.setAge(23);
        student.setGender("男");

        int id = student.getId();
        String name = student.getName();

        System.out.println(student);
    }

    @Test
    public void test2() {
        Student student1 = new Student();
        student1.setId(1);
        student1.setName("张三");
        student1.setAge(23);
        student1.setGender("女");
        System.out.println(student1);

        Student student2 = new Student(23, "李四", 23, "男");
        System.out.println(student2);
    }

    @Test
    public void test445() {
        Number number = new Number(3, 5);
        int result1 = number.add();
        System.out.println(result1);
        number.div();
    }

    @Test
    public void test45() {
        Student student = new Student(1, "zhangsan", 23, "男");
        //com.situ.day5.Student@22927a81
        System.out.println(student.toString());
    }

    @Test
    public void test343() {
        Teacher teacher = new Teacher();
        teacher.id = 1;
        teacher.name = "张三";
        teacher.age = 23;
        teacher.show();

        //静态方法调用有两种方式:
        //第一种：类名.方法名
        Teacher.print();
        //第二种：对象.方法名 不推荐
        teacher.print();

        System.out.println(Teacher.className);
        System.out.println(teacher.className);
    }

    @Test
    public void test34() {
        int max = Math.max(3, 5);
        System.out.println(max);

        //'Math()' has private access in 'java.lang.Math'
        //Math math = new Math();

        int[] array = {23, 4, 65, 78};
        int max1 = ArrayUtil.max(array);
        System.out.println(max1);

        int[] array1 = null;
        ArrayUtil.toString(array1);
        System.out.println(Arrays.toString(array1));

        ArrayUtil.bubbleSort(array);
        ArrayUtil.toString(array);
    }








}
